# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WalletObjects.V1.Model.MediaRequestInfo do
  @moduledoc """
  Extra information added to operations that support Scotty media requests.

  ## Attributes

  *   `currentBytes` (*type:* `String.t`, *default:* `nil`) - The number of current bytes uploaded or downloaded.
  *   `customData` (*type:* `String.t`, *default:* `nil`) - Data to be copied to backend requests. Custom data is returned to Scotty in the agent_state field, which Scotty will then provide in subsequent upload notifications.
  *   `diffObjectVersion` (*type:* `String.t`, *default:* `nil`) - Set if the http request info is diff encoded. The value of this field is the version number of the base revision. This is corresponding to Apiary's mediaDiffObjectVersion (//depot/google3/java/com/google/api/server/media/variable/DiffObjectVersionVariable.java). See go/esf-scotty-diff-upload for more information.
  *   `finalStatus` (*type:* `integer()`, *default:* `nil`) - The existence of the final_status field indicates that this is the last call to the agent for this request_id. http://google3/uploader/agent/scotty_agent.proto?l=737&rcl=347601929
  *   `notificationType` (*type:* `String.t`, *default:* `nil`) - The type of notification received from Scotty.
  *   `requestId` (*type:* `String.t`, *default:* `nil`) - The Scotty request ID.
  *   `requestReceivedParamsServingInfo` (*type:* `String.t`, *default:* `nil`) - The partition of the Scotty server handling this request. type is uploader_service.RequestReceivedParamsServingInfo LINT.IfChange(request_received_params_serving_info_annotations) LINT.ThenChange()
  *   `totalBytes` (*type:* `String.t`, *default:* `nil`) - The total size of the file.
  *   `totalBytesIsEstimated` (*type:* `boolean()`, *default:* `nil`) - Whether the total bytes field contains an estimated data.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :currentBytes => String.t() | nil,
          :customData => String.t() | nil,
          :diffObjectVersion => String.t() | nil,
          :finalStatus => integer() | nil,
          :notificationType => String.t() | nil,
          :requestId => String.t() | nil,
          :requestReceivedParamsServingInfo => String.t() | nil,
          :totalBytes => String.t() | nil,
          :totalBytesIsEstimated => boolean() | nil
        }

  field(:currentBytes)
  field(:customData)
  field(:diffObjectVersion)
  field(:finalStatus)
  field(:notificationType)
  field(:requestId)
  field(:requestReceivedParamsServingInfo)
  field(:totalBytes)
  field(:totalBytesIsEstimated)
end

defimpl Poison.Decoder, for: GoogleApi.WalletObjects.V1.Model.MediaRequestInfo do
  def decode(value, options) do
    GoogleApi.WalletObjects.V1.Model.MediaRequestInfo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WalletObjects.V1.Model.MediaRequestInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
